import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-platform/drug/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/blade-platform/drug/detail',
    method: 'get',
    params: {
      id,
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/blade-platform/drug/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/blade-platform/drug/save',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/blade-platform/drug/update',
    method: 'post',
    data: row
  })
}
/**
 * 药品分类 
 */
export const getDruCategoryTree = ( params) => {
  return request({
    url: '/api/blade-platform/druCategory/tree',
    method: 'get',
    params: {
      ...params,
    }
  })
}
export const removeDruCategory = (ids) => {
  return request({
    url: '/api/blade-platform/druCategory/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}
export const addDruCategory = (row) => {
  return request({
    url: '/api/blade-platform/druCategory/save',
    method: 'post',
    data: row
  })
}
export const updateDruCategory = (row) => {
  return request({
    url: '/api/blade-platform/druCategory/update',
    method: 'post',
    data: row
  })
}